package com.kernel;

import com.filehandlers.UserLoader;
import com.gui.LoginWindow;
import com.vo.User;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;

/**
 *
 * @author Matheus
 */
public final class Core 
{
    private static final Core system = new Core();
    
    private Core ()
    {
        
    }
    
    public static void main(String args[]) throws IOException
    {
        LoginWindow loginWindow = new LoginWindow(system);
        loginWindow.setVisible(true);
        Log.logStart();
    }
    /**
     * Autentica o usuario
     * @param userName Login do usuario.
     * @param password Senha do usuario.
     */
    public void authenticate(String userName, String password){
        if(UserLoader.checkUser(userName, password))
        {
            System.exit(0);
        }
        //Chama interface login caso a autenticacao nao tenha sido efetuada com sucesso
        Log.sendResponse("SEU BURRO", Log.ERROR_MSG);
    }
    
}
